package com.huluobo.a2307douyindemo.demo.eventBus

import BaseCallBack
import PermissionResult
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.ArrayUtils
import com.blankj.utilcode.util.BusUtils
import com.blankj.utilcode.util.ClickUtils
import com.blankj.utilcode.util.ColorUtils
import com.blankj.utilcode.util.GsonUtils
import com.blankj.utilcode.util.ImageUtils
import com.blankj.utilcode.util.IntentUtils
import com.blankj.utilcode.util.KeyboardUtils
import com.blankj.utilcode.util.NotificationUtils
import com.blankj.utilcode.util.RegexUtils
import com.blankj.utilcode.util.VolumeUtils
import com.huluobo.a2307douyindemo.R
import com.huluobo.a2307douyindemo.databinding.ActivityEventBusBinding
import com.huluobo.a2307douyindemo.utils.BottomSheetDialog
import com.huluobo.a2307douyindemo.utils.FileUtils
import com.huluobo.a2307douyindemo.utils.PermissionUtils
import com.huluobo.a2307douyindemo.utils.Utils
import com.huluobo.lib_base.mvvm.BaseActivity
import dagger.hilt.android.AndroidEntryPoint
import org.greenrobot.eventbus.EventBus

@AndroidEntryPoint
class EventBusActivity : BaseActivity<ActivityEventBusBinding, EventBusViewModel>() {
    override fun initData() {
    }

    override fun initView() {
        val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragmentContainerView2) as NavHostFragment
        val navHostController = navHostFragment.navController
        binding.eventNav.setupWithNavController(navHostController)

        binding.eventBtn.setOnClickListener {
//            //第四步,发送事件
//            EventBus.getDefault().post(ClickEvent())
//            EventBus.getDefault().post(ClickEvent2("url:www.baidu.com"))
//
//            val permissionUtils = PermissionUtils(this, this)
//            permissionUtils.requestPermission(PermissionUtils.Type.Location)
//            permissionUtils.setCallBack(object : BaseCallBack<Int> {
//                override fun success(data: Int) {
//                    Log.e("TagA", "请求权限:$data")
//                }
//            })
//            val bottomSheetDialog = BottomSheetDialog<String>(this)
//            val strings = listOf(
//                BottomSheetDialog.Items("1", "1"),
//                BottomSheetDialog.Items("2", "2"),
//                BottomSheetDialog.Items("3", "3"),
//            )
//            bottomSheetDialog.setItems(strings)
//            bottomSheetDialog.setOnDismissListener(object : BaseCallBack<String> {
//                override fun success(data: String) {
//                    Log.e("TagA", "点击了:$data")
//                }
//            })
            FileUtils(this, this, object : PermissionResult {
                override fun getPermission(): PermissionUtils {
                    return PermissionUtils(this@EventBusActivity, this@EventBusActivity)
                }
            }).openImage(null)
        }
    }
}